<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAssetsInjectHistorysTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
        Schema::create('assets_inject_historys', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('batch_no', 191)->comment('批次编号');
			$table->string('task_no', 50)->unique('task_no')->comment('任务编号');
			$table->integer('asset_id')->comment('媒资ID');
			$table->string('spasset_id', 100)->comment('SP 媒资ID');
			$table->integer('done_post_status')->unsigned()->nullable()->default(0)->comment('注入申请提交状态');
			$table->text('done_post_result', 65535)->nullable()->comment('申请提交反馈');
			$table->text('notify_content', 65535)->nullable()->comment('注入异步通知内容');
			$table->integer('task_status')->nullable()->default(-1)->comment('注入任务状态 1:成功 0:失败 -1:待反馈');
			$table->boolean('pic_state')->nullable()->default(-1)->comment('海报注入状态  1:成功 0:失败 -1:待反馈');
			$table->boolean('series_state')->nullable()->default(-1)->comment('主媒资注入状态  1:成功 0:失败 -1:待反馈');
			$table->boolean('program_state')->nullable()->default(-1)->comment('剧集注入状态  1:成功 0:失败 -1:待反馈');
			$table->boolean('movie_state')->nullable()->default(-1)->comment('媒资文件注入状态  1:成功 0:失败 -1:待反馈');
			$table->float('consuming_time')->nullable()->default(0.00)->comment('消耗时间');
			$table->float('used_memory')->nullable()->default(0.00)->comment('消耗内存');
			$table->text('post_content', 65535)->nullable()->comment('注入提交消息内容');
			$table->integer('user_id')->unsigned()->default(0)->comment('用户ID');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('assets_inject_historys');
	}

}
